package day06.account;

public class Account {
    private long id;
    private double balance;
    private String password;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public String getPassword() {
        return null;
    }

    public void setPassword(String password) {
        if (password.length() == 6) {
            System.out.println("请修改后提交");
        } else
            this.password = password;
    }
}

class SavingAccount extends Account {
    private double interestRate;

    public double getInterestRate() {
        return interestRate;
    }

    public void setInterestRate(double interestRate) {
        if(interestRate>0&&interestRate<0.1){
            this.interestRate = interestRate;
        }else
        System.out.println("请重新修改");

    }
}

class CreditAccount extends Account {
    private double crediLine;

    public double getCrediLine() {
        return crediLine;
    }

    public void setCrediLine(double crediLine) {
        this.crediLine = crediLine;
    }
}